package oaSystem.web.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import oaSystem.biz.FunctionBiz;
import oaSystem.biz.RoleBiz;
import oaSystem.entity.Function;
import oaSystem.entity.Role;
import oaSystem.web.security.Authorize;

@Controller
public class RoleController {
	@Autowired
	public FunctionBiz functionBiz;
	@Autowired
	public RoleBiz roleBiz;
	
	@Authorize(rules="security")
	@RequestMapping("/role")
	public String role(Model model,HttpSession session){
		List<Role> roleList = roleBiz.findAllRole();
		model.addAttribute("roleList", roleList);
		List<Function> functions = functionBiz.findAllFunction();
		session.setAttribute("functions", functions);
		return "role";
	}
	
	
}
